package com.koron.order.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName IntercepterConfig
 * @description
 * @Author zhouj
 * @Date 2022/6/1 16:33
 */
@Configuration
public class IntercepterConfig implements WebMvcConfigurer {

    @Autowired
    private ChangeControllerInterceptor changeControllerInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //addPathPatterns用于添加拦截路径
        //excludePathPatterns用于添加不拦截的路径
        registry.addInterceptor(changeControllerInterceptor).addPathPatterns("/orderChange/**");

    }

}
